#include "../guiframe/IApplication.h"
#include "../core/core.h"
#include "../core/FileSys.h"
#include "../core/DevCfg.h"
#include "../core/StyleMgr.h"
#include <QApplication>
#include <QLibrary>
#include <QDir>
#include <QProcess>
#include <qbkernel/include/qb_base.h>

using namespace qb;

int main(int argc, char *argv[]){
    IApplication* app = getAppInstance(argc, argv);
    logInfo("Main", "用户配置文件夹%s", FileSys::instance()->userCfgDir().toStdString().c_str());

    bool runOne = false;
    DevCfg::instance().getBoolean("RunOnce", runOne, true);
    QString strPath = QApplication::applicationDirPath();

    StyleMgr::instance();

    qbBase* qb = qbBase::getInterface();
    qb->init(strPath.toUtf8().toStdString().c_str());

    app->run();
    releaseApp();
    qb->terminate();

    return 0;
}
